using UnityEngine;
using QFramework;

namespace dilao
{
	public partial class EnemyGernerator : ViewController
	{
		float borntime = 1.5f;
        private void Update()
        {
            borntime -= Time.deltaTime;
            if(borntime<=0&&Player.GetInstance())
            {
                borntime = 1.5f;
                float randomangle = Random.Range(0, 360);
                Vector3 randomdirection = new Vector3(Mathf.Cos(randomangle * Mathf.Deg2Rad), Mathf.Sin(randomangle * Mathf.Deg2Rad));
                Instantiate(Enemy).Rotation(Quaternion.identity).Position(randomdirection*5).Show();
            }
        }
    }
}
